package com.threeti.mecool.core.domain.model.worker;

import java.util.Random;
import com.threeti.mecool.core.domain.model.plan.pojo.RouteStep;
import com.threeti.mecool.core.domain.model.plan.pojo.RouteStepItem;
import com.threeti.mecool.core.domain.model.plan.pojo.TaskAction;
import com.threeti.mecool.core.domain.model.plan.pojo.UserStep;

public class SelectSingleActionWorker extends ActionWorker {

	@Override
	public String doAction(UserStep userStep, TaskAction action) {
		RouteStep routeStep = (RouteStep) userStep.getStep();
		Random random = new Random(System.nanoTime());
		RouteStepItem item = routeStep.getItems().get(random.nextInt(routeStep.getItems().size()));
		return String.valueOf(item.getId());
	}

}
